package com.day12.exer1;

public class Cylinder extends Circle{
    private double length;//高

    public Cylinder(){
//        super();//可省
        length = 1.0;
    }

    public double getLength(){
        return length;
    }
    public void setLength(double length){
        this.length = length;
    }

    //返回圆柱的体积
    public double findVolume(){
        return super.findArea() * length;
//        return Math.PI * getRadiue() * getRadiue() * getLength();
    }

    @Override
    public double findArea() {//返回圆柱的表面积
        return Math.PI * getRadiue() * getRadiue() * 2 + 2 * Math.PI * getRadiue() * getLength();
    }
}
